import React from 'react';

function HistoryPanel({ selectedConversation, onSelect }) {
    const conversations = [
        { id: 'Initial Greeting', title: 'Initial Greeting' },
        { id: 'Image Source Analysis', title: 'Image Source Analysis' },
    ];

    return (
        <div className="history-panel">
            <button className="new-conversation-btn">+ 新建对话</button>
            <input type="text" placeholder="搜索" />
            <ul>
                {conversations.map(conversation => (
                    <li
                        key={conversation.id}
                        className={conversation.id === selectedConversation ? 'active' : ''}
                        onClick={() => onSelect(conversation.id)}
                    >
                        {conversation.title}
                    </li>
                ))}
            </ul>
        </div>
    );
}

export default HistoryPanel;